package com.engine4cloud.tdf.admin.api.dto;

import com.engine4cloud.tdf.common.core.constant.enums.FileBucketNameEnum;
import com.engine4cloud.tdf.common.core.constant.enums.FileDirEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 文件上传-文件请求
 *
 * @author wenjie
 * @date 2024/03/11
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "文件上传-请求对象")
public class SysFileDownloadRequestDTO implements Serializable {

    public SysFileDownloadRequestDTO(FileBucketNameEnum bucketName, FileDirEnum dir, String fileName) {
        this.bucketName = bucketName;
        this.dir = dir;
        this.fileName = fileName;
    }

    @Schema(description = "桶名字: SYS-系统;SUPERVISION-监督管理;LOCATION-定位;PSYCHOLOGY-心理;TERMINAL-终端管理", example = "SUPERVISION")
    @NotNull(message = "桶名字不能为空")
    private FileBucketNameEnum bucketName;

    /**
     * 文件夹
     */
    @Schema(description = "文件夹：SUPERVISION_CORRECTOR_PHOTOGRAPH-监督管理矫正对象照片;" +
            "SUPERVISION_CORRECTOR_FACIAL_DIAGNOSIS-监督管理矫正对象人脸特征;" +
            "SUPERVISION_CORRECTOR_FINGERPRINT-监督管理矫正对象指纹特征;" +
            "SUPERVISION_CORRECTOR_VOCAL_PRINT-监督管理矫正对象声纹特征;" +
            "SUPERVISION_CORRECTOR_LEGAL_INSTRUMENT-监督管理矫正对象法律文书;" +
            "SUPERVISION_CORRECTOR_LEGAL_INSTRUMENT_TEMPLATE-监督管理矫正对象法律文书模版;" +
            "SUPERVISION_CORRECTOR_ACTIVE_FILE-监督管理矫正对象日常活动文件;" +
            "SUPERVISION_EDUCATION_MATERIAL-监督管理教育学习资料;" +
            "SUPERVISION_FUNCTIONARY_PHOTOGRAPH-监督管理工作人员照片;" +
            "SYS_USER_PHOTOGRAPH-系统管理用户照片", example = "SUPERVISION_CORRECTOR_LEGAL_INSTRUMENT")
    @NotNull(message = "文件夹不能为空")
    private FileDirEnum dir;

    @Schema(description = "子目录，拼接与dir后面")
    private String childDir;

    /**
     * 文件组
     */
    @Schema(description = "文件名")
    @NotBlank(message = "文件名不存在")
    private String fileName;

}
